<template>
  <el-container class="main-root">
    <el-aside width="220px">
      <Sidebar />
    </el-aside>
    <el-container>
      <el-header>
        <Header />
      </el-header>
      <el-main class="main-content-area">
        <router-view v-slot="{ Component }">
          <transition enter-active-class="animate__animated animate__bounceInRight"
            leave-active-class="animate__animated animate__bounceOutRight" mode="out-in">
            <component :is="Component" :key="$route.path" />
          </transition>
        </router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup>
import Sidebar from '@/components/common/Sidebar.vue'
import Header from '@/components/common/Header.vue'
</script>

<style scoped>
.main-root {
  width: 100vw;
  height: 100vh;
}

.main-content-area {
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  overflow-x: hidden;
  --animate-duration: 0.6s;
}
</style>